package com.sxbbc.common.core.enums;

import java.util.ArrayList;
import java.util.List;

import com.sxbbc.common.basics.utils.calculation.CalcuUtils;

/**
 * 
 * 账号冻结的业务枚举类
 * 唯一原则：账户只进不出
 * 用户冻结 
 * 商家冻结 
 * 代理冻结
 * 
 * @author Wahyee
 */
public enum UserFreezeEnums {
	CUSTOMER(1,"用户冻结"),
	BUSINESS(2,"商家冻结"),
	AGENT(3,"代理冻结"),
	CUSTOMER_PAY(101,"用户余额&积分支付冻结"),
	CUSTOMER_CASH(102,"用户余额提现冻结"),
	CUSTOMER_POINT_TO_DONATE(103,"用户积分转贡献值冻结"),
	CUSTOMER_SHARE_TO_MONEY(104,"用户共享值转余额冻结"),
	CUSTOMER_OFFLINE_BUY(105,"用户线下买单冻结"),
	CUSTOMER_RED(105,"用户账户发红包冻结"),
	BUSINESS_CASH(201,"商家余额提现冻结");

	
	private Integer id;

	private String name;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private UserFreezeEnums(Integer id, String name) {
		this.id = id;
		this.name = name;
	}

	public static List<UserFreezeEnums> queryList() {
		List<UserFreezeEnums> list = new ArrayList<UserFreezeEnums>();
		for (UserFreezeEnums o : UserFreezeEnums.values()) {
			list.add(o);
		}
		return list;
	}

	public static String getName(Integer id) {
		String str = "";
		for (UserFreezeEnums o : UserFreezeEnums.values()) {
			if (CalcuUtils.getInstance().isEquals(id, o.getId())) {
				str = o.getName();
				break;
			}
		}
		return str;
	}
}
